package com.shashidi.weather.https;

import com.gtdev5.geetolsdk.mylibrary.beans.DataResultBean;
import com.gtdev5.geetolsdk.mylibrary.beans.ListResultBean;
import com.gtdev5.geetolsdk.mylibrary.callback.BaseCallback;
import com.gtdev5.geetolsdk.mylibrary.contants.API;
import com.gtdev5.geetolsdk.mylibrary.contants.Contants;
import com.gtdev5.geetolsdk.mylibrary.http.HttpUtils;
import com.gtdev5.geetolsdk.mylibrary.util.MapUtils;
import com.gtdev5.geetolsdk.mylibrary.util.SpUtils;
import com.shashidi.weather.bean.CityNumberBean;

public class HttpDefine {

    /**
     * 获取站点编号
     */
    public static final String API_GET_SITE_NUMBER = "weather.get_site";

    public static String getUrl(String url) {
        String commonUrl = SpUtils.getInstance().getString(Contants.COMMON_URL, API.COMMON_URL);
        return commonUrl + url;
    }

    /**
     * 获取所有站点编号列表
     */
    public static void getAllCityNumber(BaseCallback<ListResultBean<CityNumberBean>> callback) {
        HttpUtils.getInstance().post(getUrl(API_GET_SITE_NUMBER), MapUtils.getCurrencyMap(), callback);
    }
}
